<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>07_判断变量的数据类型-constructor</title>
    </head>
    <body>
        <script>
            console.log('abc'.constructor == String);

            var a = 1;
            console.log(a.constructor == Number);

            console.log(true.constructor == Boolean);

            // null、undefined没有construstor方法，因此constructor不能判断undefined和null。
            console.log(undefined.constructor == undefined);
            console.log(null.constructor == null);
        </script>
    </body>
</html>